package com.bite.messageQueue.common;

import com.bite.messageQueue.mqServer.core.ExchangeType;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class ExchangeDeclareArguments extends BasicArguments implements Serializable {
    //用name来表示交换机的身份标识
    private String name;
    //交换机类型
    private ExchangeType exchangeType;
    //表示该交换机是否要持久化
    private boolean durable;
    //如果当前交换机没人使用了就会自动删除
    private boolean autoDelete;
    //表示交换机的一些扩展参数选项
    private Map<String, Object> arguments;

    public ExchangeDeclareArguments() {
    }

    public ExchangeDeclareArguments(String name, ExchangeType exchangeType, boolean durable, boolean autoDelete, Map<String, Object> arguments) {
        this.name = name;
        this.exchangeType = exchangeType;
        this.durable = durable;
        this.autoDelete = autoDelete;
        this.arguments = arguments;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return exchangeType
     */
    public ExchangeType getExchangeType() {
        return exchangeType;
    }

    /**
     * 设置
     * @param exchangeType
     */
    public void setExchangeType(ExchangeType exchangeType) {
        this.exchangeType = exchangeType;
    }

    /**
     * 获取
     * @return durable
     */
    public boolean isDurable() {
        return durable;
    }

    /**
     * 设置
     * @param durable
     */
    public void setDurable(boolean durable) {
        this.durable = durable;
    }

    /**
     * 获取
     * @return autoDelete
     */
    public boolean isAutoDelete() {
        return autoDelete;
    }

    /**
     * 设置
     * @param autoDelete
     */
    public void setAutoDelete(boolean autoDelete) {
        this.autoDelete = autoDelete;
    }

    /**
     * 获取
     * @return arguments
     */
    public Map<String, Object> getArguments() {
        return arguments;
    }

    /**
     * 设置
     * @param arguments
     */
    public void setArguments(Map<String, Object> arguments) {
        this.arguments = arguments;
    }

    public String toString() {
        return "ExchangeDeclareArguments{name = " + name + ", exchangeType = " + exchangeType + ", durable = " + durable + ", autoDelete = " + autoDelete + ", arguments = " + arguments + "}";
    }
}
